<template>
	<view>
		<!-- #ifdef APP || H5 -->
		 <view class="bg_1" style="background-color: #93a2ff;"></view>
			<view class="flex_row_between_center home_top"   :style="{ top: 'calc(' + statusBarHeight + ' + 0rpx)',height: '100rpx', }">
				<view class="topic">读道</view>
				<view class="" style="display: flex;align-items: center;">
					<view class="" style="margin-right: 16rpx;">
						<!-- <uni-icons color="#fa9919" fontFamily="CustomFont" :size="26">{{'\ue648'}}</uni-icons> -->
					</view>
					<view class="" style="margin-right: 16rpx;position: relative;">
						<uni-icons @click="addsignfn" v-if="signstate==0" color="#fff" fontFamily="CustomFont" :size="30">{{'\ue698'}}</uni-icons>
					    <uni-icons @click="navTo('/pages/moreModule/sign/sign')" v-if="signstate==1" color="#fff" fontFamily="CustomFont" :size="26">{{'\ue625'}}</uni-icons>
						 <view v-if="signstate==0" class="dot"  style="width: 16rpx;height: 16rpx;
						 background-color: #fc523b;border-radius: 50%;
						 position: absolute;top: 15rpx;right: 4rpx;border: 2rpx solid #fff;">
					     	
					     </view>
					</view>
					<view class="home_top_ad" @click="addArchives">
						<uni-icons type="plusempty" color="#fff" size="18"></uni-icons>
					</view>
				</view>
			</view>
		<!-- #endif -->
		<!-- #ifdef MP-WEIXIN -->
		     <view class="bg_1" ></view>
		     <view class="flex_row_start_center home_top"   :style="{ top: 'calc(' + statusBarHeight + ' + 20rpx)' }">
			   <view class="topic">读道</view>
			   <view class="" style="display: flex;align-items: center;margin-left: 110px">
					<view class="" style="margin-right: 16rpx;position: relative;">
						<uni-icons @click="addsignfn" v-if="signstate==0" color="#fff" fontFamily="CustomFont" :size="30">{{'\ue698'}}</uni-icons>
						<uni-icons @click="navTo('/pages/moreModule/sign/sign')" v-if="signstate==1" color="#fff" fontFamily="CustomFont" :size="26">{{'\ue625'}}</uni-icons>
						 <view v-if="signstate==0" class="dot"  style="width: 16rpx;height: 16rpx;
						 background-color: #fc523b;border-radius: 50%;
						 position: absolute;top: 15rpx;right: 4rpx;border: 2rpx solid #fff;">
							
						 </view>
					</view>
					<view class="home_top_ad" @click="addArchives">
						<uni-icons type="plusempty" color="#fff" size="18"></uni-icons>
					</view>
			   </view>
		     </view>
		<!-- #endif -->
		
		<view   :style="{ 'margin-top': 'calc(' + statusBarHeight + ' + 100rpx)' }" >
			<view class="new">
				<view>
					<view class="home_userInfo"  >
						<view  class="flex_row_between_center home_userInfo_title">
							<view class="home_userInfo_title_l ">
								<text>{{useInfo.masterName}}</text>
								<text>{{useInfo.masterBirthday}}</text>
							</view>
							<view   class="flex_row_start_center home_userInfo_title_r" @click="navTo('/pages/index/archives')">
								<view class="lg text-pink cuIcon-post" style="margin-top: 4rpx;margin-right: 4rpx;"></view>
								<view>生日</view>
							</view>
						</view >
						<view class="bazi">
							<view class="flex_row_start_center bazi_table_top" >
								<view class="bazi_table_top_l1">
									<view v-if="useInfo.masterSex == '男'">乾造(男)</view>
									<view v-if="useInfo.masterSex == '女'">坤造(女)</view>
								</view>
								<view>年柱</view>
								<view>月柱</view>
								<view>日柱</view>
								<view>时柱</view>
							</view>
							<view class="flex_row_start_center bazi_table_top2" >
								<view class="bazi_table_l1">天干</view>
								<view class="lattice" >
									<view class="report2_content_tuwen ">
										<view v-if="nianZhuTian.wuXing == '金'" style="color: #e7950e;">{{nianZhuTian.tianGan}}</view>
										<view v-if="nianZhuTian.wuXing == '木'" style="color: #2de24e;">{{nianZhuTian.tianGan}}</view>
										<view v-if="nianZhuTian.wuXing == '水'" style="color: #3083f7;">{{nianZhuTian.tianGan}}</view>
										<view v-if="nianZhuTian.wuXing == '火'" style="color: #d10600;">{{nianZhuTian.tianGan}}</view>
										<view v-if="nianZhuTian.wuXing == '土'" style="color: #876d07">{{nianZhuTian.tianGan}}</view>
										<image v-if="nianZhuTian.wuXing == '金'" src="../../static/images/other/jin.png" mode="aspectFit" class="report2_content_tuwen_i"></image>
										<image v-if="nianZhuTian.wuXing == '木'" src="../../static/images/other/mu.png" mode="aspectFit" class="report2_content_tuwen_i"></image>
										<image v-if="nianZhuTian.wuXing == '水'" src="../../static/images/other/shui.png" mode="aspectFit" class="report2_content_tuwen_i"></image>
										<image v-if="nianZhuTian.wuXing == '火'" src="../../static/images/other/huo.png" mode="aspectFit" class="report2_content_tuwen_i"></image>
										<image v-if="nianZhuTian.wuXing == '土'" src="../../static/images/other/tu.png" mode="aspectFit" class="report2_content_tuwen_i"></image>
									</view>
								</view>
								<view class="lattice">
									<view class="report2_content_tuwen ">
										<view v-if="yueZhuTian.wuXing == '金'" style="color: #e7950e;">{{yueZhuTian.tianGan}}</view>
										<view v-if="yueZhuTian.wuXing == '木'" style="color: #2de24e;">{{yueZhuTian.tianGan}}</view>
										<view v-if="yueZhuTian.wuXing == '水'" style="color: #3083f7;">{{yueZhuTian.tianGan}}</view>
										<view v-if="yueZhuTian.wuXing == '火'" style="color: #d10600;">{{yueZhuTian.tianGan}}</view>
										<view v-if="yueZhuTian.wuXing == '土'" style="color: #876d07">{{yueZhuTian.tianGan}}</view>
										<image v-if="yueZhuTian.wuXing == '金'" src="../../static/images/other/jin.png" mode="aspectFit" class="report2_content_tuwen_i"></image>
										<image v-if="yueZhuTian.wuXing == '木'" src="../../static/images/other/mu.png" mode="aspectFit" class="report2_content_tuwen_i"></image>
										<image v-if="yueZhuTian.wuXing == '水'" src="../../static/images/other/shui.png" mode="aspectFit" class="report2_content_tuwen_i"></image>
										<image v-if="yueZhuTian.wuXing == '火'" src="../../static/images/other/huo.png" mode="aspectFit" class="report2_content_tuwen_i"></image>
										<image v-if="yueZhuTian.wuXing == '土'" src="../../static/images/other/tu.png" mode="aspectFit" class="report2_content_tuwen_i"></image>
									</view>
								</view>
								<view class="lattice">
									<view class="report2_content_tuwen ">
										<view v-if="riZhuTian.wuXing == '金'" style="color: #e7950e;">{{riZhuTian.tianGan}}</view>
										<view v-if="riZhuTian.wuXing == '木'" style="color: #2de24e;">{{riZhuTian.tianGan}}</view>
										<view v-if="riZhuTian.wuXing == '水'" style="color: #3083f7;">{{riZhuTian.tianGan}}</view>
										<view v-if="riZhuTian.wuXing == '火'" style="color: #d10600;">{{riZhuTian.tianGan}}</view>
										<view v-if="riZhuTian.wuXing == '土'" style="color: #876d07">{{riZhuTian.tianGan}}</view>
										<image v-if="riZhuTian.wuXing == '金'" src="../../static/images/other/jin.png" mode="aspectFit" class="report2_content_tuwen_i"></image>
										<image v-if="riZhuTian.wuXing == '木'" src="../../static/images/other/mu.png" mode="aspectFit" class="report2_content_tuwen_i"></image>
										<image v-if="riZhuTian.wuXing == '水'" src="../../static/images/other/shui.png" mode="aspectFit" class="report2_content_tuwen_i"></image>
										<image v-if="riZhuTian.wuXing == '火'" src="../../static/images/other/huo.png" mode="aspectFit" class="report2_content_tuwen_i"></image>
										<image v-if="riZhuTian.wuXing == '土'" src="../../static/images/other/tu.png" mode="aspectFit" class="report2_content_tuwen_i"></image>
									</view>
								</view>
								<view class="lattice">
									<view class="report2_content_tuwen ">
										<view v-if="shiZhuTian.wuXing == '金'" style="color: #e7950e;">{{shiZhuTian.tianGan}}</view>
										<view v-if="shiZhuTian.wuXing == '木'" style="color: #2de24e;">{{shiZhuTian.tianGan}}</view>
										<view v-if="shiZhuTian.wuXing == '水'" style="color: #3083f7;">{{shiZhuTian.tianGan}}</view>
										<view v-if="shiZhuTian.wuXing == '火'" style="color: #d10600;">{{shiZhuTian.tianGan}}</view>
										<view v-if="shiZhuTian.wuXing == '土'" style="color: #876d07">{{shiZhuTian.tianGan}}</view>
										<image v-if="shiZhuTian.wuXing == '金'" src="../../static/images/other/jin.png" mode="aspectFit" class="report2_content_tuwen_i"></image>
										<image v-if="shiZhuTian.wuXing == '木'" src="../../static/images/other/mu.png" mode="aspectFit" class="report2_content_tuwen_i"></image>
										<image v-if="shiZhuTian.wuXing == '水'" src="../../static/images/other/shui.png" mode="aspectFit" class="report2_content_tuwen_i"></image>
										<image v-if="shiZhuTian.wuXing == '火'" src="../../static/images/other/huo.png" mode="aspectFit" class="report2_content_tuwen_i"></image>
										<image v-if="shiZhuTian.wuXing == '土'" src="../../static/images/other/tu.png" mode="aspectFit" class="report2_content_tuwen_i"></image>
									</view>
								</view>
							</view>
							<view class="flex_row_start_center bazi_table_top2" >
								<view class="bazi_table_l1">地支</view>
								<view class="lattice">
									<view class="report2_content_tuwen ">
										<view v-if="nianZhuDi.wuXing == '金'" style="color: #e7950e;">{{nianZhuDi.diZhi}}</view>
										<view v-if="nianZhuDi.wuXing == '木'" style="color: #2de24e;">{{nianZhuDi.diZhi}}</view>
										<view v-if="nianZhuDi.wuXing == '水'" style="color: #3083f7;">{{nianZhuDi.diZhi}}</view>
										<view v-if="nianZhuDi.wuXing == '火'" style="color: #d10600;">{{nianZhuDi.diZhi}}</view>
										<view v-if="nianZhuDi.wuXing == '土'" style="color: #876d07">{{nianZhuDi.diZhi}}</view>
									  <image v-if="nianZhuDi.wuXing == '金'" src="../../static/images/other/jin.png" mode="aspectFit" class="report2_content_tuwen_i"></image>
									  <image v-if="nianZhuDi.wuXing == '木'" src="../../static/images/other/mu.png" mode="aspectFit" class="report2_content_tuwen_i"></image>
									  <image v-if="nianZhuDi.wuXing == '水'" src="../../static/images/other/shui.png" mode="aspectFit" class="report2_content_tuwen_i"></image>
									  <image v-if="nianZhuDi.wuXing == '火'" src="../../static/images/other/huo.png" mode="aspectFit" class="report2_content_tuwen_i"></image>
									  <image v-if="nianZhuDi.wuXing == '土'" src="../../static/images/other/tu.png" mode="aspectFit" class="report2_content_tuwen_i"></image>
									</view>
								</view>
								
								<view class="lattice">
									<view class="report2_content_tuwen ">
										<view v-if="yueZhuDi.wuXing == '金'" style="color: #e7950e;">{{yueZhuDi.diZhi}}</view>
										<view v-if="yueZhuDi.wuXing == '木'" style="color: #2de24e;">{{yueZhuDi.diZhi}}</view>
										<view v-if="yueZhuDi.wuXing == '水'" style="color: #3083f7;">{{yueZhuDi.diZhi}}</view>
										<view v-if="yueZhuDi.wuXing == '火'" style="color: #d10600;">{{yueZhuDi.diZhi}}</view>
										<view v-if="yueZhuDi.wuXing == '土'" style="color: #876d07">{{yueZhuDi.diZhi}}</view>
										
										<image v-if="yueZhuDi.wuXing == '金'" src="../../static/images/other/jin.png" mode="aspectFit" class="report2_content_tuwen_i"></image>
										<image v-if="yueZhuDi.wuXing == '木'" src="../../static/images/other/mu.png" mode="aspectFit" class="report2_content_tuwen_i"></image>
										<image v-if="yueZhuDi.wuXing == '水'" src="../../static/images/other/shui.png" mode="aspectFit" class="report2_content_tuwen_i"></image>
										<image v-if="yueZhuDi.wuXing == '火'" src="../../static/images/other/huo.png" mode="aspectFit" class="report2_content_tuwen_i"></image>
										<image v-if="yueZhuDi.wuXing == '土'" src="../../static/images/other/tu.png" mode="aspectFit" class="report2_content_tuwen_i"></image>
									</view>
								</view>
								<view class="lattice">
									<view class="report2_content_tuwen ">
										<view v-if="riZhuDi.wuXing == '金'" style="color: #e7950e;">{{riZhuDi.diZhi}}</view>
										<view v-if="riZhuDi.wuXing == '木'" style="color: #2de24e;">{{riZhuDi.diZhi}}</view>
										<view v-if="riZhuDi.wuXing == '水'" style="color: #3083f7;">{{riZhuDi.diZhi}}</view>
										<view v-if="riZhuDi.wuXing == '火'" style="color: #d10600;">{{riZhuDi.diZhi}}</view>
										<view v-if="riZhuDi.wuXing == '土'" style="color: #876d07">{{riZhuDi.diZhi}}</view>
										<image v-if="riZhuDi.wuXing == '金'" src="../../static/images/other/jin.png" mode="aspectFit" class="report2_content_tuwen_i"></image>
										<image v-if="riZhuDi.wuXing == '木'" src="../../static/images/other/mu.png" mode="aspectFit" class="report2_content_tuwen_i"></image>
										<image v-if="riZhuDi.wuXing == '水'" src="../../static/images/other/shui.png" mode="aspectFit" class="report2_content_tuwen_i"></image>
										<image v-if="riZhuDi.wuXing == '火'" src="../../static/images/other/huo.png" mode="aspectFit" class="report2_content_tuwen_i"></image>
										<image v-if="riZhuDi.wuXing == '土'" src="../../static/images/other/tu.png" mode="aspectFit" class="report2_content_tuwen_i"></image>
									</view>
								</view>
								<view class="lattice">
									<view class="report2_content_tuwen ">
										<view v-if="shiZhuDi.wuXing == '金'" style="color: #e7950e;">{{shiZhuDi.diZhi}}</view>
										<view v-if="shiZhuDi.wuXing == '木'" style="color: #2de24e;">{{shiZhuDi.diZhi}}</view>
										<view v-if="shiZhuDi.wuXing == '水'" style="color: #3083f7;">{{shiZhuDi.diZhi}}</view>
										<view v-if="shiZhuDi.wuXing == '火'" style="color: #d10600;">{{shiZhuDi.diZhi}}</view>
										<view v-if="shiZhuDi.wuXing == '土'" style="color: #876d07">  {{shiZhuDi.diZhi}}</view>
										<image v-if="shiZhuDi.wuXing == '金'" src="../../static/images/other/jin.png" mode="aspectFit" class="report2_content_tuwen_i"></image>
										<image v-if="shiZhuDi.wuXing == '木'" src="../../static/images/other/mu.png" mode="aspectFit" class="report2_content_tuwen_i"></image>
										<image v-if="shiZhuDi.wuXing == '水'" src="../../static/images/other/shui.png" mode="aspectFit" class="report2_content_tuwen_i"></image>
										<image v-if="shiZhuDi.wuXing == '火'" src="../../static/images/other/huo.png" mode="aspectFit" class="report2_content_tuwen_i"></image>
										<image v-if="shiZhuDi.wuXing == '土'" src="../../static/images/other/tu.png" mode="aspectFit" class="report2_content_tuwen_i"></image>
									</view>
								</view>
							</view>
						</view>
					</view>
				</view>
				<view class="new_m ">
					<swiper   class="swiper-box" circular >
							<swiper-item class="swiper_item"  v-for="(value,idx) in powerList" :key="idx" >
							    <view class="new_scroll_list" v-for="(item,index) in value" :key="index"  >
							    	<view class="new_scroll_item" v-if="item.paramInt==1"  @click="navTo(item.paramDesc)">
							    		<image :src="item.paramVarchar" mode="aspectFit" class="home_module_img"></image>
							    		<view>{{item.paramName}}</view>
							    	</view>
							    </view>	
							</swiper-item>
					</swiper>
					
				</view>
			</view>
			<view class="new_tab" >
				<view class="navbar" >
				  <view
				    v-for="(item, index) in navList"
				    :key="index"
				    class="nav-item"
				    :class="{ current: tabCurrentIndex === index }"
				    @click="tabClick(index)"
				  >
				    {{ item.text }}
				  </view>
				</view>
				<swiper
				  :current="tabCurrentIndex"
				  class="swiper-box2"
				  duration="300"
				  @change="changeTab"
				  
				>
				  <swiper-item
				    class="tab-content"
				    v-for="(tabItem, tabIndex) in navList"
				    :key="tabIndex"
				  >
				    
					<view >
						<template>
							  <view
								v-if="
								  tabItem.loadingState != 'first_loading' &&
								  tabItem.balanceList.length == 0
								"
								class="empty_part flex_column_start_center"
							  >
								<text>'还没有数据哦～</text>
							  </view>
							<view class="log">
								<view
								   v-for="(item, index) in tabItem.balanceList"
								   :key="index"
								   class="log-item "
								   @click="navTos2(item)"
								 >
									  <image v-if="item.picture" :src="item.picture.split(',')[0]" class="log_image" mode="widthFix"></image>
									  <view v-else class="log_article">
										  <view>{{item.content}}</view>
									  </view>
									  <view  class="log-item-title" v-if="item.title" >{{item.title}}</view>
									  <view class="flex_row_between_end  log_desc">
										  <view class="flex_row_start_end">
											  <image :src="item.member.memberAvatar" mode="aspectFit" class="log_desc_image"></image>
											  <view>{{item.member.memberNickName}}</view>
										  </view>
										  <view class="flex_row_start_end">
											  <uni-icons type="hand-up" size="18" color="#8c8c8c"></uni-icons>
											  <view v-if="item.likeCount>0">{{item.likeCount}}</view>
										  </view>
									  </view>
									 
								 </view>
							</view>
						  </template>
					</view>
				  </swiper-item>
				</swiper>
			</view>
		</view>
		<!-- 登录提示框 -->
		<loginPop ref="loginPop"  ></loginPop>
		<!--  完善信息提示框-->
			<uni-popup ref="alertDialog" type="dialog">
						<uni-popup-dialog type="info" cancelText="关闭" confirmText="去完善" title="提示" content="为了更好的体验,请完善个人信息." @confirm="dialogConfirm"
							@close="dialogClose"></uni-popup-dialog>
			</uni-popup>
			<!-- 引导填写档案页面 -->
			<!-- <uni-popup ref="yinDaoDialog" background-color="#fff">
				 <view class="popup-content" style="height: 100vh;width: 750rpx;">
					 11111
					 <view class="">
					 	2223
					 </view>
				 </view>
			 </uni-popup>
			 <view class="" @click="openyinDao">
			 	打开弹框
			 </view> -->
	</view>
</template>


<script>
	import {getAddressLocation} from "@/utils/common.js";
	import {mapState,mapMutations} from 'vuex'
	import {Solar,SolarMonth,Lunar,HolidayUtil}from'@/pages/common/lunar.js';
	import {sloarToLunar,getYearMonthDay,getDayGanzhi } from '@/utils/lunar.js'
	import loadingState from "@/components/loading-state.vue";
	export default {
		components: {
			loadingState
		},
		data(){
			return{
				nowYear:new Date().getFullYear(),//获取年份
				nowMonth:new Date().getMonth()+1 >10 ? new Date().getMonth()+1:'0'+(new Date().getMonth()+1) ,//获取月份
				nowDay:new Date().getDate() >10 ? new Date().getDate():'0'+new Date().getDate(),
				statusBarHeight:getApp().globalData.statusBarHeight+'px',
				useInfo:{},
				baziInfo:{},
				numCount:{
					jin:0,
					mu:0,
					shui:0,
					huo:0,
					tu:0,
				},
				powerList:[],
				moduleTrue:false,
				auditShow:false,
				navList: [{
						state: 0,
						text: '推荐',
						loadingState: 'first_loading',
						balanceList: [],
						current: 1, //分页
					},
					{
						state: 1,
						text: '星座',
						loadingState: 'first_loading',
						balanceList: [],
						current: 1, //分页
					},
					{
						state: 2,
						text: '测试',
						loadingState: 'first_loading',
						balanceList: [],
						current: 1, //分页
					},
					{
						state: 3,
						text: '心理',
						loadingState: 'first_loading',
						balanceList: [],
						current: 1, //分页
					},
					{
						state: 4,
						text: '交友',
						loadingState: 'first_loading',
						balanceList: [],
						current: 1, //分页
					},
				],
				tabCurrentIndex:0,
				nianZhuTian:{},
				yueZhuTian:{},
				riZhuTian:{},
				shiZhuTian:{},
				nianZhuDi:{},
				yueZhuDi:{},
				riZhuDi:{},
				shiZhuDi:{},
				signstate:0,//签到状态 0 未签 1 已签
				prnumber:0,//
				scrollTrue:false,
			}
		},
		mounted(){
			this.getsignstate()
		},
		onPageScroll() {
		let view = uni.createSelectorQuery().in(this).select(".new_tab");
			view.boundingClientRect(data => {
				console.log("得到布局位置信息" + JSON.stringify(data));
				if(data.top<92){
					this.scrollTrue = true;
				}else{
					this.scrollTrue = false;
				}
				console.log('this.scrollTrue',this.scrollTrue);
			}).exec();
		},
		onShareAppMessage(){
			return{
					title:'读道',
					path:'/pages/index/index',
					imageUrl:'../../static/images/other/logo.png',
				}
		},
		 onShareTimeline(){//分享朋友圈
			return {
				title:'读道', //分享标题
				query: '/pages/index/index' , // 可不填 传递的参数，只能是这 
				imageUrl:'../../static/images/other/logo.png',
			}
		 },
		 // 下拉刷新
		 onPullDownRefresh(){
		       this.getAudit()
		       this.getUserInfo()
		       this.getPower()
			   this.getsignstate()
		       if(!this.hasLogin){
				   this.$nextTick(() => {
				   		  // DOM已更新，现在可以安全地使用 this.$refs  
				   	   this.$refs.loginPop.openLogin()
				   					});
		       }else{
		       		this.getbaziinfo()
		       }
			   setTimeout(()=>{
				   uni.stopPullDownRefresh()
			   },2000)
			   
			   
		 },
		onShow(){
		  // this.loadData()
		  this.getAudit()
		  this.getUserInfo()
		  this.getPower()
		   
		},
		onLoad(){
			 if(this.userCenterData.loginNumber==1 && uni.getStorageSync('prnumber')==0){
				 // 跳转引导页
					uni.navigateTo({
				 	url:'/pages/index/profileLead/profileLead'
				 })
			 }
			  this.loadData()
		},
		computed: {
			...mapState(['hasLogin', 'userInfo', 'userCenterData'])
		},
		methods:{
			// 点击签到
				
			addsignfn(){
				 
				if(!this.hasLogin){
				this.$nextTick(() => {
									  // DOM已更新，现在可以安全地使用 this.$refs  
									  this.$refs.loginPop.openLogin()
									});
				}else{
					this.$request({
						url:"v3/sign/front/add"
					}).then(res=>{
						if(res.state==200){
							this.$modal.msg('签到成功')
							setTimeout(()=>{
								uni.navigateTo({
									url:"/pages/moreModule/sign/sign"
								})
							},1000)
							
						}else{
							console.log(res);
						}
					})
					
				}
			},
			// 获取签到状态
			getsignstate(){
				
				if(!this.hasLogin){
					this.$nextTick(() => {
										  // DOM已更新，现在可以安全地使用 this.$refs  
										  this.$refs.loginPop.openLogin()
										});
				}else{
					this.$request({
						url:'v3/sign/front/detail',
						method:'GET'
					}).then(res=>{
						 if(res.state==200){
							 this.signstate=res.data.status
						 }else{
							 console.log(res);
						 }
						
					})
				}
				
			},
             
			goCurrent(e){
				console.log('e',e);
				let index = Number(e)-1;
				this.tabCurrentIndex=index;
				let navItem = this.navList.filter(item => item.state == index)[0];
				navItem.balanceList=[]
				navItem.loadingState = 'first_loading';
				this.loadData()
			},
			/* tab跳转区详情 */
			navTos2(item){
			    let url="/pages/index/reportdetail"
				const obj = {
					id:item.discussPostId
				}
				
				// 将对象参数转为JSON字符串，并使用encodeURIComponent编码
				const params = encodeURIComponent(JSON.stringify(obj));
				
				// 跳转页面并传递对象参数
				uni.navigateTo({
				   url: `${url}?params=${params}`
				});
			},
			navTo2(tabCurrentIndex){
				let url='/pages/index/publish'
				let params=tabCurrentIndex+1
				uni.navigateTo({
				   url: `${url}?params=${params}`
				});
				// this.$tab.navigateTo('/pages/index/publish')
			},
			tabClick(index){
				this.tabCurrentIndex=index
			},
			/* 跳转档案新增页面  */
			addArchives(){
				if(!this.hasLogin){
					this.$nextTick(() => {
										  // DOM已更新，现在可以安全地使用 this.$refs  
										  this.$refs.loginPop.openLogin()
										});
				}else{
					this.$tab.navigateTo('/pages/index/addArchives')
				}
			},
			 
			   
			// 是否填写档案信息
			getbaziinfo(){
				this.$request({url:'v3/member/front/master/detail'}).then(res=>{
					if(!res.data){
						// 没有填写个人信息
							this.useInfo=uni.getStorageSync('exampleInfo')
							let data={
								name:this.useInfo.masterName,
								year:this.useInfo.masterBirthday.split(' ')[0].split('/')[0],
								month:this.useInfo.masterBirthday.split(' ')[0].split('/')[1],
								day:this.useInfo.masterBirthday.split(' ')[0].split('/')[2],
								hour:this.useInfo.masterBirthday.split(' ')[1].split(':')[0],
								minute:this.useInfo.masterBirthday.split(' ')[1].split(':')[1],
								selectAddressCode:this.useInfo.masterAddressCode,
								selectAddress:this.useInfo.masterAddress,
								gender:this.useInfo.masterSex,
								isLeap:this.useInfo.isLeap
							}
							this.$refs.alertDialog.open()
							if(data.isLeap === null){
								this.getFortune(data)
							}else if(data.isLeap.toString() =='true' ||data.isLeap.toString() =='false'){
								 this.getFortune2(data)
							}
					}
				})
			},
			// 去填写
			dialogConfirm(){
				uni.navigateTo({
					url:'/pages/index/addArchives'
				})
			},
			// 关闭弹框
			dialogClose(){
				console.log('关闭');
			},
			//获取微信审核开关
			getAudit(){
			    let param = {};
				param.url='v3/system/front/configuration/1'
				this.$request(param).then(res=>{
					console.log(res);
					this.auditShow=res.data.auditSwitch
					
				})
			},
			getPower(){
				let param = {
					
				};
				param.url='v3/system/front/param/list'
				param.data={
					pageNum:1,
					pageSize:20
				}
				this.$request(param).then(res=>{
					// this.powerList=res.rows
					this.powerList=this.getList(res.rows)
					this.getJudgment(res.rows)
				})
			},
			//将显示的模块放入新数组
			getList(list){
				let list2=list.filter(item=>{ return item.paramInt==1})
				
			     const result = [];
				  for (let i = 0; i < list2.length; i += 10) {
					result.push(list2.slice(i, i + 10));
					 // console.log('result1',result);
				  }
				  console.log('result',result);
				return result;
			},
			//判断是否有显示的图标功能模块
			getJudgment(list){
				let result = list.findIndex(item =>{return item.paramInt ==1});
			    this.moduleTrue= result == -1 ? false : true
				
			},
			getUserInfo(){
				if(!this.hasLogin){
					
					this.useInfo=uni.getStorageSync('exampleInfo')
					let data={
						name:this.useInfo.masterName,
						year:this.useInfo.masterBirthday.split(' ')[0].split('/')[0],
						month:this.useInfo.masterBirthday.split(' ')[0].split('/')[1],
						day:this.useInfo.masterBirthday.split(' ')[0].split('/')[2],
						hour:this.useInfo.masterBirthday.split(' ')[1].split(':')[0],
						minute:this.useInfo.masterBirthday.split(' ')[1].split(':')[1],
						selectAddressCode:this.useInfo.masterAddressCode,
						selectAddress:this.useInfo.masterAddress,
						gender:this.useInfo.masterSex,
						isLeap:this.useInfo.isLeap
					}
					
					if(data.isLeap === null){
						this.getFortune(data)
					}else if(data.isLeap.toString() =='true' ||data.isLeap.toString() =='false'){
						 this.getFortune2(data)
					}
				}else{
					let param = {};
					param.url='v3/member/front/master/detail'
					this.$request(param).then(res =>{
						// console.log(res);
						if(res.data){
							this.useInfo=res.data
							let data={
								name:res.data.masterName,
								year:res.data.masterBirthday.split(' ')[0].split('/')[0],
								month:res.data.masterBirthday.split(' ')[0].split('/')[1],
								day:res.data.masterBirthday.split(' ')[0].split('/')[2],
								hour:res.data.masterBirthday.split(' ')[1].split(':')[0],
								minute:res.data.masterBirthday.split(' ')[1].split(':')[1],
								selectAddressCode:res.data.masterAddressCode,
								selectAddress:res.data.masterAddress,
								gender:res.data.masterSex,
								isLeap:res.data.isLeap
							}
							
							if(res.data.isLeap === null){
								this.getFortune(data)
							}else if(res.data.isLeap.toString() =='true' ||res.data.isLeap.toString() =='false'){
								 this.getFortune2(data)
							}
						}else{
							this.useInfo=uni.getStorageSync('exampleInfo')
							let data={
								name:this.useInfo.masterName,
								year:this.useInfo.masterBirthday.split(' ')[0].split('/')[0],
								month:this.useInfo.masterBirthday.split(' ')[0].split('/')[1],
								day:this.useInfo.masterBirthday.split(' ')[0].split('/')[2],
								hour:this.useInfo.masterBirthday.split(' ')[1].split(':')[0],
								minute:this.useInfo.masterBirthday.split(' ')[1].split(':')[1],
								selectAddressCode:this.useInfo.masterAddressCode,
								selectAddress:this.useInfo.masterAddress,
								gender:this.useInfo.masterSex,
								isLeap:this.useInfo.isLeap
							}
							
							if(data.isLeap === null){
								this.getFortune(data)
							}else if(data.isLeap.toString() =='true' ||data.isLeap.toString() =='false'){
								 this.getFortune2(data)
							}
						}
					})
				}
			},
			//阳历获取天干
			getFortune(value){
				// console.log('qe');
				// console.log('value',value);
				let param = {};
				param.urls='scbz/convertedCalendar'
				param.data=value
				param.header={
					'Content-Type': 'application/json;charset=utf-8',
				}
				this.$request(param).then(res=>{
					// console.log('res1',res);
					this.dataInfo=res
					this.baziInfo=res.baZiWuXing
					this.nianZhuTian=res.baZiWuXing.nianZhu.tianGan
					this.yueZhuTian=res.baZiWuXing.yueZhu.tianGan
					this.riZhuTian=res.baZiWuXing.riZhu.tianGan
					this.shiZhuTian=res.baZiWuXing.shiZhu.tianGan
					this.nianZhuDi=res.baZiWuXing.nianZhu.diZhi
					this.yueZhuDi=res.baZiWuXing.yueZhu.diZhi
					this.riZhuDi=res.baZiWuXing.riZhu.diZhi
					this.shiZhuDi=res.baZiWuXing.shiZhu.diZhi
					this.getNum()
				})
			},
			//阴历获取天干
			getFortune2(value){
			
				let param = {};
				param.urls='scbz/convertedSolarCalendar'
				param.data=value
				param.header={
					'Content-Type': 'application/json;charset=utf-8',
				},
				this.$request(param).then(res=>{
					// console.log(res);
					this.dataInfo=res
					this.baziInfo=res.baZiWuXing
					this.nianZhuTian=res.baZiWuXing.nianZhu.tianGan
					this.yueZhuTian=res.baZiWuXing.yueZhu.tianGan
					this.riZhuTian=res.baZiWuXing.riZhu.tianGan
					this.shiZhuTian=res.baZiWuXing.shiZhu.tianGan
					this.nianZhuDi=res.baZiWuXing.nianZhu.diZhi
					this.yueZhuDi=res.baZiWuXing.yueZhu.diZhi
					this.riZhuDi=res.baZiWuXing.riZhu.diZhi
					this.shiZhuDi=res.baZiWuXing.shiZhu.diZhi
					this.getNum()
				})
			},
			getNum(){
				let arr=[]
				this.numCount.jin=0
				this.numCount.mu=0
				this.numCount.shui=0
				this.numCount.huo=0
				this.numCount.tu=0
			
				arr.push(this.baziInfo.nianZhu.tianGan.wuXing)
				arr.push(this.baziInfo.yueZhu.tianGan.wuXing)
				arr.push(this.baziInfo.riZhu.tianGan.wuXing)
				arr.push(this.baziInfo.shiZhu.tianGan.wuXing)
				arr.push(this.baziInfo.nianZhu.diZhi.wuXing)
				arr.push(this.baziInfo.yueZhu.diZhi.wuXing)
				arr.push(this.baziInfo.riZhu.diZhi.wuXing)
				arr.push(this.baziInfo.shiZhu.diZhi.wuXing)
				// console.log('arr',arr);
				arr.forEach((item)=>{
					if(item=='金'){
						this.numCount.jin+=1
					}else if(item=='木'){
						this.numCount.mu+=1
					}else if(item=='水'){
						this.numCount.shui+=1
					}else if(item=='火'){
						this.numCount.huo+=1
					}else if(item=='土'){
						this.numCount.tu+=1
					}
				})
			},
			getBazi(value){
				console.log(value,111);
				// console.log(value.replace(/\//g,'-'));
				var d = Lunar.fromDate(new Date(value));
				let data={
					yearGan:d.getEightChar().getYearGan(),
					yearZhi:d.getEightChar().getYearZhi(),
					monthGan:d.getEightChar().getMonthGan(),
					monthZhi:d.getEightChar().getMonthZhi(),
					dayGan:d.getEightChar().getDayGan(),
					dayZhi:d.getEightChar().getDayZhi(),
					hoursGan:d.getEightChar().getTimeGan(),
					hoursZhi:d.getEightChar().getTimeZhi(),
					yearGanWuxing:d.getEightChar().getYearWuXing().substring(0,1),
					yearZhiWuxing:d.getEightChar().getYearWuXing().substring(1,2),
					monthGanWuxing:d.getEightChar().getMonthWuXing().substring(0,1),
					monthZhiWuxing:d.getEightChar().getMonthWuXing().substring(1,2),
					dayGanWuxing:d.getEightChar().getDayWuXing().substring(0,1),
					dayZhiWuxing:d.getEightChar().getDayWuXing().substring(1,2),
					hoursGanWuxing:d.getEightChar().getTimeWuXing().substring(0,1),
					hoursZhiWuxing:d.getEightChar().getTimeWuXing().substring(1,2),
				}
				
				this.baziInfo=data
				// console.log(data);
				
				this.wuxingNum.jinNum=0
				this.wuxingNum.muNum=0
				this.wuxingNum.shuiNum=0
				this.wuxingNum.huoNum=0
				this.wuxingNum.tuNum=0
				
				
				let arr=[];
				arr.push(data.yearGanWuxing);
				arr.push(data.yearZhiWuxing);
				arr.push(data.monthGanWuxing);
				arr.push(data.monthZhiWuxing);
				arr.push(data.dayGanWuxing);
				arr.push(data.dayZhiWuxing);
				arr.push(data.hoursGanWuxing);
				arr.push(data.hoursZhiWuxing);
				
				arr.forEach((item)=>{
					if(item=='金'){
						this.wuxingNum.jinNum+=1
					}else if(item=='木'){
						this.wuxingNum.muNum+=1
					}else if(item=='水'){
						this.wuxingNum.shuiNum+=1
					}else if(item=='火'){
						this.wuxingNum.huoNum+=1
					}else if(item=='土'){
						this.wuxingNum.tuNum+=1
					}
				})
				
			},
			//提示
			getToast(){
				this.$modal.msg('该功能待开发')
			},
			// 查询命主信息
			getMingZhu(){
				let param = {};
				param.url='v3/member/front/master/detail'
				this.$request(param).then(res =>{
					console.log(res);
				})
			},
			
		
			navTo(url){
				this.$tab.navigateTo(url)
			},
			//获取当天日历与宜忌
			getCurrentInfo(){
				
				var d = Lunar.fromDate(new Date());
				
				this.lunarInfo.lunarMonth=d.getMonthInChinese()
				this.lunarInfo.lunarDay=d.getDayInChinese()
				this.lunarInfo.yi=d.getDayYi();
				this.lunarInfo.ji=d.getDayJi();
				this.lunarInfo.ganZhiYear=d.getYearInGanZhiExact()
				this.lunarInfo.ganZhiMonth=d.getMonthInGanZhiExact()
				this.lunarInfo.ganZhiDay=d.getDayInGanZhiExact()
				
			},
			getDate() {
				const date = new Date();
				let year = date.getFullYear();
				let month = date.getMonth() + 1;
				let day = date.getDate();
	
				month = month > 9 ? month : '0' + month;
				day = day > 9 ? day : '0' + day;
				return `${year}/${month}/${day} 00:00:00`;
			},
			changeTab(e) {
				this.tabCurrentIndex = e.target.current;
				this.loadData('tabChange');
			},
			/* 获取列表数据 */
			loadData(source){
				 
				//将订单挂载到tab列表下,起到缓存的效果，避免多次请求
				let index = this.tabCurrentIndex;
				let navItem = this.navList.filter(item => item.state == index)[0];
				let state = navItem.state;
				
				// if (source === 'tabChange' && navItem.loadingState !== 'first_loading') {
				// 	//tab切换只有第一次需要加载数据
				// 	return;
				// }
				if (navItem.loadingState === 'loading') {
					//防止重复加载
					return;
				}
				
				if (navItem.loadingState == 'no_more_data') {
					//已经没有数据，无需再请求
					return;
				}
				let param = {};
				param.url = 'v3/discuss/front/list';
				param.data = {};
				param.data.postType = navItem.state+1;
				// param.data.memberId = this.userCenterData.memberId;
				
				param.data.pageSize = 10;
				param.data.current = navItem.current;
				navItem.loadingState = navItem.loadingState == 'first_loading' ? navItem.loadingState : 'loading';
				param.data.state = navItem.state;
				
				this.$request(param).then(res => {
					console.log('resss',res);
					if (res.state == 200) {
						navItem.balanceList = navItem.balanceList.concat(res.data.list);
						let hasMore = this.$checkPaginationHasMore(res.data.pagination); //是否还有数据
						navItem.loadingState = 'no_more_data';
					} else {
						this.$modal.msg(res.msg);
					}
					console.log('navList',this.navList);
				}).catch((e) => {
					//异常处理
				})
			},
		
		}
	}
</script>

<style lang="scss">
	page{
		background-color: #fafafa;
		// background-color: #c1b9ae;
	}
	
	.home_top_ad{
		border: 4rpx solid #fff;
		padding: 5rpx;
		border-radius: 50%;
	}
	
	.bazi{
         color: #fff !important;
		.bazi_table_top{
			// padding-left: 112rpx;
			// padding-top: 20rpx;
			.bazi_table_top_l1{
				width: 110rpx;;
				margin-right: 6rpx;
				text-align: center;
			}
			font-size: 24rpx;
			& view{
				width:136rpx;
				height: 60rpx;
				font-size: 26rpx;
				// color: #9a9a9a;
				display: flex;
				justify-content: center;
				align-items: center;
				// background-color: red;
			}
		}
		.bazi_table_top2{
			// margin-top: 34rpx;
			.bazi_table_l1{
				width: 104rpx;;
				margin-right: 24rpx;
				text-align: center;
				// color: #9a9a9a;
				color: #fff;
				font-size: 28rpx;
			}
			.lattice{
				width: 132rpx;;
				height: 60rpx;
				font-size: 26rpx;
				display: flex;
				justify-content: center;
				align-items: center;
				margin-left: 10rpx;
				.report2_content_tuwen{
					display: flex;
					align-items: center;
					font-size: 28rpx;
					font-weight: 550;
					// color: rgb(245, 195, 113);
					
					.report2_content_tuwen_i{
						width: 32rpx;
						height: 32rpx;
						margin-left: 14rpx;
					}
				}
			}
		}
	}
	
	
	.home_image{
		width: 38rpx;
		height: 38rpx;
		margin-left: 14rpx;
	}
	
	.bg_1 {
		position: fixed;
		top: 0;
		left: 0;
		width: 750rpx;
		height:130rpx;
		z-index: 998;
		right: 0;
		margin: 0 auto;
		// background: #fff;
		background-color: #93a2ff;
	}
	.home_top{
		position: fixed;
		left: 0;
		padding: 10rpx 35rpx;
		z-index: 999;
		width: 750rpx;
		background-color: #93a2ff;
		
		.topic{
			font-size: 50rpx;
			color: #9B4C3A;
			font-family: SimSun;
			margin-right: 38rpx;
			font-weight: 550;
			color: #ffffff;
		
		}
		
		.home_input{
			background-color: #F5F5F5;
			width: 380rpx;
			height: 62rpx;
			border-radius: 116rpx;
			padding-left: 26rpx;
		}
	}
	.home_info{
		// padding: 24rpx 28rpx;
	}
	.home_userInfo{
		padding: 24rpx  20rpx 10rpx 20rpx;
		margin: 20rpx 32rpx;
		border-radius: 30rpx;
		color: #fff;
		// background-color: #fff;
		//  opacity:0.2;
		
		.home_userInfo_title{
			font-size: 24rpx;
			padding-bottom: 14rpx;
		
			.home_userInfo_title_l{
				font-size:26rpx;
				
				& text:first-child{
					margin-right: 14rpx;
				}
			}
			.home_userInfo_title_r{
				background-color: #ffe6ef;
				color: #e589ac;
				font-size: 26rpx;
				padding: 8rpx 16rpx;
				border-radius: 20rpx;
			}
		}
		
		
	}
	
	
	
	/* 新版 */
	.new{
		position: relative;
		height: 460rpx;
	    background-image: linear-gradient( 150deg, #94a7fe,#92a3ff,#8ea4ff,#8ac0fe);
		border-radius: 0 0 205rpx 205rpx/0 0 60rpx 60rpx;
		margin-bottom: 170rpx;
	}
	
	.new_m{
		background-color: #fff;
		margin: 10rpx 28rpx;
		position: absolute;
		top: 280rpx;
		width: 694rpx;
		min-height: 50rpx;
		border-radius: 40rpx;
		padding: 25rpx 20rpx;
		box-shadow: 0px 3px 25px #fafafe;
		
		

	}
	.swiper-box{
		height: calc(100vw * 9 / 28);
	}
	.swiper_item{
		display: flex;
		align-items: start;
		flex-wrap: wrap;	
	}
	.new_scroll_list{
		width: 20%;
	}
	.new_scroll_item{
		padding: 10rpx 0;
		text-align: center;
	}
	.home_module_img{
		width: 66rpx;
		height: 66rpx;
	}
	
	
	/* tab */
	.new_tab{
		background-color: #fff;
	}
		
	
	.navbar {
		
	  display: flex;
	  justify-content: space-around; 
	  height: 80rpx;
	  padding: 0 5px;
	  background: #fff;
	  // background: red;
	  z-index: 10;
	
	  .nav-item {
	    // flex: 1;
	    display: flex;
	    justify-content: center;
		width: 100rpx;
	    align-items: center;
	    height: 100%;
	    font-size: 28rpx;
	    position: relative;
	
	    &.current {
	      color: #93a2ff;
	      font-size: 30rpx;
	
	      &:after {
	        content: '';
	        position: absolute;
	        left: 50%;
	        bottom: 4rpx;
	        transform: translateX(-50%);
	        width: 35rpx;
	        height: 8rpx;
	        background-color: #93a2ff;
	        border-radius: 4rpx;
	      }
	    }
	  }
	}
	
	.uni-swiper-item {
	  height: auto;
	}
	
	
	
	.swiper-box2 {
	  height: calc(100vh - 128px);
	  // background-color: red;
	  padding-bottom: 20px;
	  
	}
	
	.list-scroll-content {
	  // height: 100%;
	   height: calc(100vh - 130px);
	  // background-color: #f9f9f9;
	  // background-color: yellow;
	}
	.log{
		column-count: 2;
		column-gap: 10px;
		padding: 22rpx ;
		// padding-bottom: 200rpx;
	}
	.log-item {
		 width: 100%;
		 break-inside: avoid;
		 background-color: #fff;
		 margin-bottom: 16rpx;
	     border-radius: 20rpx;
	}
	.log_article{
		padding: 34rpx 22rpx;
		border-radius: 20rpx 20rpx 0 0;
		color: #7a70a6;
		
		background-image: linear-gradient(45deg,#f5f2fd,#ece9fe);
		& view{
			max-height: 156rpx;
		overflow: hidden;
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-line-clamp: 3;
		-webkit-box-orient: vertical;
		}
		
	}
	.log_image{
		width:100%;
		border-radius: 20rpx 20rpx 0 0;
	}
	.log-item-title{
		 white-space: nowrap;   //不换行
		 overflow: hidden;       //超出部分隐藏
		 text-overflow: ellipsis;    //文本溢出显示省略号
		 font-size: 26rpx;
		 // margin: 8rpx 0;
		 padding: 10rpx 22rpx;
	}
		 
	.log_desc{
		color: #727272;
		padding: 10rpx 22rpx;
	}
	.log_desc_image{
		width: 40rpx;
		height: 40rpx;
		border-radius: 50%;
		margin-right: 10rpx;
	}
	

	/* 多行省略 */
	.multi-line-omit {
	  word-break: break-all; // 允许单词内自动换行，如果一个单词很长的话
	  text-overflow: ellipsis; // 溢出用省略号显示
	  overflow: hidden; // 超出的文本隐藏
	  display: -webkit-box; // 作为弹性伸缩盒子模型显示
	  -webkit-line-clamp: 2; // 显示的行
	  -webkit-box-orient: vertical; // 设置伸缩盒子的子元素排列方式--从上到下垂直排列
	}
	/* 单行省略 */
	.one-line-omit {
	  width: 100%; // 宽度100%：1vw等于视口宽度的1%；1vh等于视口高度的1%
	  white-space: nowrap; // 溢出不换行
	  overflow: hidden; // 超出的文本隐藏
	  text-overflow: ellipsis; // 溢出用省略号显示
	}
    

	
	.empty_part {
	  padding-top: 160rpx;
	 
	  text {
	    color: #5e5e5e;
	    font-size: 30rpx;
	    margin-top: 57rpx;
	  }
	
	  
	}
</style>